﻿using System;
using System.Web;
using System.Web.Security;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Check();
        }

        private void Check()
        {
            if (HttpContext.Current != null)
            {
                if (Roles.IsUserInRole("系统管理员"))
                {
                    this.P1.Visible = true;
                    this.P2.Visible = true;
                    this.P3.Visible = true;
                    this.P4.Visible = true;
                    this.P5.Visible = true;
                }
                if (Roles.IsUserInRole("查询用户"))
                {
                    this.P2.Visible = true;
                }
                if (Roles.IsUserInRole("工装工具管理员"))
                {
                    this.P1.Visible = true;
                    this.P2.Visible = true;
                    this.P3.Visible = true;
                }
                if (Roles.IsUserInRole("基础信息管理员"))
                {
                    this.P1.Visible = true;
                    this.P2.Visible = true;
                    this.P3.Visible = true;
                    this.P5.Visible = true;
                }
            }
        }
    }
}
